﻿@model JT.WEB.Models.Were.TbChuRuInfo

@{
    ViewData["Title"] = "出入信息-新增";
}

<div class="row">
    <div class="col-md-4">
        <form asp-action="Create">
           <div asp-validation-summary="All" class="text-danger"></div>
           
            <div class="form-group">
                <label asp-for="ItemNameNavigation" class="control-label"></label>
                <input asp-for="ItemNameNavigation" class="form-control" list="itemName" />
                <datalist id="itemName">
                    @foreach (var item in ViewBag.ItemName)
                    {
                        <option value="@item.ItemName"></option>
                    }
                </datalist>

                <span asp-validation-for="ItemNameNavigation" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Count" class="control-label"></label>
                <input asp-for="Count" class="form-control" value="0" />
                <span asp-validation-for="Count" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="ChangeDate" class="control-label"></label>
                <input asp-for="ChangeDate" class="form-control " id="date_info"  />

                <style>
                    input[type=datetime-local]::-webkit-inner-spin-button {
                        visibility: hidden;
                    }
                </style>
                <span asp-validation-for="ChangeDate" class="text-danger"></span>

            </div>
            <div class="form-group">
                <div class="radio">
                    <label>
                        <input asp-for="IsRuKu" type="radio" checked="checked" value="1" /> 入库
                    </label>
                    <label>
                        <input asp-for="IsRuKu" type="radio" value="0" /> 出库
                    </label>
                </div>
                 
            </div>
            <div class="form-group">
              
                <input type="submit" value="保存" class="btn btn-outline-success" />
            </div>
        </form>
    </div>
</div>

<div>
    <a asp-action="Index">返回列表</a>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}

<script>
    var today = new Date();
var yyyy = today.getFullYear();
var MM = today.getMonth() + 1;
var dd = today.getDate();
var hh = today.getHours();
var mm = today.getMinutes();
MM = checkTime(MM);
dd = checkTime(dd);
hh = checkTime(hh);
mm = checkTime(mm);
var time = yyyy + "-" + MM + "-" + dd + "T" + hh + ":" + mm;

var dateControl = document.querySelector("#date_info");
dateControl.value = time;
</script>